package org.zqs.getclient.controller;

import org.zqs.getclient.service.GetIpService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;


/**
 * @Program: Spring-mvc-learn
 * @Description:
 * @Author: zqs
 * @Create： 2021-09-09-16:19
 */
@Controller
@RequestMapping("/user")
public class GetIpController {
    @ResponseBody
    @RequestMapping(value = "/ip.do")
    public String getIpAddress(HttpServletRequest request) {
        return GetIpService.getClientIpAddr(request);
    }

}
